/*
 *  QMMatch.h
 *  QuickMatch
 *
 *  Created by Leroy Ketelaars on 8/13/09.
 *  Copyright 2009 Universum7. All rights reserved.
 *
 */

#ifndef __QM_MATCH_H__
#define __QM_MATCH_H__

#include <iostream>
#include <vector>
#include "QMView.h"
#include "QMPlayerContainer.h"
#include "QMWidget.h"
#include "QMPoint.h"
#include "QMOptionsStrip.h"

class QMMatch: public QMView
{
public:
	int										num_players;
	int										selected_player;
	vector<QMPlayerContainer>				players;
	vector<QMPlayerContainer>::iterator		players_iter;
	
	QMWidget								widget;
	QMOptionsStrip							options;
	SDL_Surface*							vs_seperator;
	bool									mousedragflag;
	QMPoint									position;
		
	
	bool handleInteraction();	
	
	QMMatch();
	~QMMatch();
	
	void setBounds(int x, int y, int w = 0, int h = 0)
	{
		if(w == 0)
		{
			this->widget.bounds.x = x;
			this->widget.bounds.y = y;
			this->bounds.x = x;
			this->bounds.y = y;
		}
		else
		{
			this->widget.bounds.x = x;
			this->widget.bounds.y = y;
			this->widget.bounds.w = w;
			this->widget.bounds.h = h;
			this->bounds.x = x;
			this->bounds.y = y;
			this->bounds.w = w;
			this->bounds.h = h;
		}
		printf("%p:QMMatchSet new bounds: x %d / y %d\n", this, this->bounds.x, this->bounds.y);
	}
};

#endif

